﻿@{
    ViewBag.Title = "采购计划列表";
    Layout = "~/Views/Shared/_LayoutList.cshtml"; 
}
@(       
 Html.DWZGridFor<MaterialPurchasePlan>()
    .Title("采购计划")
    .Action(@Url.Action("List"))
    .DefaultSortOption("Date")
    .Columns(col =>
    {
        col.Bind(e => e.Id).IsKey();
        col.Bind(e => e.Date).Width(70).DateFormat("yyyy-MM-dd");
        col.Bind(e => e.SupplierName).Width(160).Align(FlexiGridAlign.Left);
        col.Bind(e => e.Category).EnumKey("MaterialCategory").Width(60);
        col.Bind(e => e.Code).Width(60);
        col.Bind(e => e.Name).Width(100).Align(FlexiGridAlign.Left);
        col.Bind(e => e.TotalWeight).Width(50).Align(FlexiGridAlign.Right);
        col.Bind(e => e.PurchaseWeight).Width(50).Align(FlexiGridAlign.Right);
        col.Bind(e => e.ActualSorage).Width(50).Align(FlexiGridAlign.Right);
        col.Bind(e => e.SafeStorage).Width(50).Align(FlexiGridAlign.Right);
    })
    .Buttons(btn =>
    {
        btn.Bind("Add", "生成采购单", FlexiGridButtonType.Add).OnPress("CrateOrder");
    })
)
<script type="text/javascript">
    function CrateOrder() {
        OpenModelWindow('@Url.Action("SetectType")', { width: 610, height: 450, caption: "生成采购单", onclose: refreshGrid });
    }
</script>
